// us core lib
#include <lua.h>
#include <lauxlib.h>
#include <stdio.h>
#include <uuid/uuid.h>

static int lguid(lua_State *L) {
    uuid_t uuid;
    uuid_generate(uuid);
    
    lua_pushlstring(L, (char *)uuid, sizeof(uuid_t));
    return 1;
}

int luaopen_us_core(lua_State *L) {

    luaL_Reg l[] = {
        { "guid", lguid },
        { NULL, NULL },
    };
    luaL_newlib(L, l);

    return 1;
}
